prefix evaluation using stack